package com.mareas.web.model;

// Generated 20/11/2011 19:14:33 by Hibernate Tools 3.4.0.CR1

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * Item generated by hbm2java
 */
@Entity
@Table(name = "item", catalog = "mareasdb")
public class Item implements java.io.Serializable {

	private Integer itemId;
	private String itemDescripcion;
	private BigDecimal itemCosto;
	private Set<Operacion> operacions = new HashSet<Operacion>(0);

	public Item() {
	}

	public Item(String itemDescripcion, BigDecimal itemCosto,
			Set<Operacion> operacions) {
		this.itemDescripcion = itemDescripcion;
		this.itemCosto = itemCosto;
		this.operacions = operacions;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "Item_ID", unique = true, nullable = false)
	public Integer getItemId() {
		return this.itemId;
	}

	public void setItemId(Integer itemId) {
		this.itemId = itemId;
	}

	@Column(name = "Item_descripcion", length = 30)
	public String getItemDescripcion() {
		return this.itemDescripcion;
	}

	public void setItemDescripcion(String itemDescripcion) {
		this.itemDescripcion = itemDescripcion;
	}

	@Column(name = "Item_Costo", precision = 8)
	public BigDecimal getItemCosto() {
		return this.itemCosto;
	}

	public void setItemCosto(BigDecimal itemCosto) {
		this.itemCosto = itemCosto;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "operacion_item", catalog = "mareasdb", joinColumns = { @JoinColumn(name = "Item_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "Operacion_ID", nullable = false, updatable = false) })
	public Set<Operacion> getOperacions() {
		return this.operacions;
	}

	public void setOperacions(Set<Operacion> operacions) {
		this.operacions = operacions;
	}

}
